Ext.define("PCD.controller.Personal",{
	extend: "Ext.app.Controller",

	views: [
		"PersonalPanel",
		"pcd.PcdList",
		"car.CarList",
		"gps.List"
	],

	stores: [
		"Gps"
	],

	init:function(){
		this.control({
			"personalPanel treeview":{
				itemdblclick:this.dblclick
			}
		});
	},

	cache:{},

	dblclick:function(view,record,item,index,e,opts){
		var klass = record.raw["klass"];

    	var tabs = view.up().up().up().down("tabPanel");

    	var tab = tabs.add({
		    	xtype:klass,
		    	closable: true
		});

    	tabs.setActiveTab(tab);
    }
});